package com.john.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.john.base.PageInfo;
import com.john.bean.User;
import com.john.bean.vo.UserVo;
import com.john.mapper.UserMapper;
import com.john.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class UserServiceImpl extends ServiceImpl<UserMapper,User>  implements UserService{


    @Autowired
    private UserMapper userMapper;

    public List<User> selectByEmail(UserVo userVo) {
        User user = new User();
        user.setEmail(userVo.getEmail());
        EntityWrapper<User> wrapper = new EntityWrapper<User>(user);
        if (0 != userVo.getId()) {
            wrapper.where("id != {0}", userVo.getId());
        }
        return this.selectList(wrapper);    }

    public void insertByVo(UserVo userVo) {

    }

    public UserVo selectVoById(int id) {
        return null;
    }

    public void updateByVo(UserVo userVo) {

    }

    public void updatePwdByUserId(int userId, String md5Hex) {

    }

    public void selectDataGrid(PageInfo pageInfo) {

    }

    public void deleteUserById(int id) {

    }
}
